package bk.ss;

import java.applet.*;
import java.awt.*;
import java.awt.event.*;

public class Day06Test2 extends Applet implements MouseListener {

	/**
	 * @param args
	 */
	private int[ ] xCoords;
    private int[ ] yCoords;
    private int numberPoints;

    public void init( )
    {
        setSize(300, 300);
        xCoords = new int[1000];
        yCoords = new int[1000];
        numberPoints = 0;
        setBackground(Color.orange);
        setForeground(Color.blue);
        addMouseListener(this);  // register itself as the mouse listener
    }
    public void paint(Graphics g)
    {
        g.drawPolyline(xCoords, yCoords, numberPoints);
    }

    public void mouseClicked(MouseEvent event)
    {
        xCoords[numberPoints] = event.getX( );
        yCoords[numberPoints] = event.getY( );
        ++numberPoints;
        repaint( );
    }
    public void mousePressed(MouseEvent event) { }
    public void mouseReleased(MouseEvent event) { }
    public void mouseEntered(MouseEvent event) { }
    public void mouseExited(MouseEvent event) { }



}
